import React from "react";
import * as PropTypes from "prop-types";
import {Link} from "react-router-dom";

export default class Item extends React.Component
{
    /**
     * 默认属性
     */
    static defaultProps =
    {
        url : "/",
        title : "菜单元素"
    };

    /**
     * 属性类型
     */
    static propTypes =
    {
        url : PropTypes.string.isRequired,
        title : PropTypes.string.isRequired
    };

    render ()
    {
        return <li>
            <Link to={this.props.url}>{this.props.title}</Link>
        </li>
    }
}